package com.fulin.jvm.classLoader;
/**
*
* @description 
* @auther fulin16@crnet.com.hk
* @since 2019年3月20日 下午5:37:50
*
*/
public class Single {
	public static void main(String[] args) {
		Singleton singleton = Singleton.getInstance();
		System.out.println("i => "+Singleton.i);
		System.out.println("j => "+Singleton.j);
	}
}

class Singleton{
	public static int i;
	
	private static Singleton singleton = new Singleton();
	
	private Singleton(){
		System.out.println("singleton 构造函数开始");
		i ++;
		j ++;
		System.out.println("singleton 构造函数结束");
	}
	public static int j = 0;
	
	public static Singleton getInstance(){
		System.out.println("获取实例开始");
		return singleton;
	}
}